package com.view.test.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.view.test.R;
import com.view.test.model.ChannelModel;
import com.view.test.view.ChannelManagerView;

import java.util.ArrayList;


public class ChannelManagerActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_channel_manager);

        ArrayList<ChannelModel> models = new ArrayList<>();
        for (int i = 0; i < 13; i++) {
            ChannelModel channelModel = new ChannelModel();
            channelModel.setChannelName(" @ " + i);
            models.add(channelModel);
        }

        final ChannelManagerView channel_manager = findViewById(R.id.channel_manager);
        channel_manager.setDatas(models);
        channel_manager.disableLongClick(false);
        channel_manager.setOnClickCallBack(new ChannelManagerView.OnClickCallBack() {
            @Override
            public void onClick(View v, int position, ChannelModel channelModel) {
                Log.i("setOnClickCallBack",channelModel.toString());
            }
        });

    }
}
